<% content_for :sitemap do %>
  <span class="current"><%= t('admin.menu.photos') %></span>
<% end %>

<table class="table table-bordered table-striped table-condensed">
  <tr>
    <td>#</td>
    <td>预览</td>
    <td>上传者</td>
    <td></td>
  </tr>

<% @photos.each do |photo| %>
  <tr>
    <td><%= photo.id %></td>
    <td><%= link_to image_tag(photo.image.url(:md), style: "width: 150px"), photo.image.url, target: "_blank" if !photo[:image].blank? %></td>
    <td><%= photo.user.login if !photo.user.blank? %></td>
    <td><%= link_to '', admin_photo_path(photo), 'data-confirm' => 'Are you sure?', method: :delete, class: "fa fa-trash" %></td>
  </tr>
<% end %>
</table>
<%= paginate @photos %>
<br />

<%= link_to 'New Photo', new_admin_photo_path %>
